import request from '@/utils/request'

// 查询流水号记录列表
export function listSequence(query) {
  return request({
    url: '/kanban/sequence/list',
    method: 'get',
    params: query
  })
}

// 查询流水号记录详细
export function getSequence(id) {
  return request({
    url: '/kanban/sequence/' + id,
    method: 'get'
  })
}

// 新增流水号记录
export function addSequence(data) {
  return request({
    url: '/kanban/sequence',
    method: 'post',
    data: data
  })
}

// 修改流水号记录
export function updateSequence(data) {
  return request({
    url: '/kanban/sequence',
    method: 'put',
    data: data
  })
}

// 删除流水号记录
export function delSequence(id) {
  return request({
    url: '/kanban/sequence/' + id,
    method: 'delete'
  })
}

// 生成临时流水号
export function generateTempSequenceNumber(seqKey, length) {
  return request({
    url: '/kanban/sequence/temp',
    method: 'get',
    params: {
      seqKey: seqKey,
      length: length
    }
  })
}

// 生成正式流水号
export function generateFormalSequenceNumber(seqKey, length) {
  return request({
    url: '/kanban/sequence/formal',
    method: 'post',
    params: {
      seqKey: seqKey,
      length: length
    }
  })
}